<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html>
<head>
    <title>抽取专家查看</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="${ctx}/lib/js/html5shiv.min.js"></script>
        <script src="${ctx}/lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
							
    <section class="content-header">
        <h1>抽取专家查看</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">专家抽取管理</a></li>
            <li class="active"><a href="#">抽取规则设置</a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="form-inline">
                    <div class="form-group form-group-xs">
                        <label for="searchPharCode">专家姓名：</label>
                        <input class="form-control" type="text" id="name" placeholder="专家姓名" maxlength="100" />
                    </div>                
                    <button type="button" class="btn btn-success btn-sm" onclick="search();">查&nbsp;询</button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
        <div class=" box box-warning bottongroup">
            <label class="btn btn-default btn-sm" onclick="back()">返&nbsp;回</label>
        </div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp"%>
    
    <script type="text/javascript">
       //分配账户
    	function back(){
    		document.location.href="toExpertExtractRuleList.html";
    	}
    	//查询
    	function search(page) {
    		var name = $("#name").val();
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{"name":name},
    	        page : (page || 1)
    	    }).trigger("reloadGrid"); //重新载入  
    	}
        $(function () {
            $("#gridlist").jqGrid({
                url: "getExtractExpertList.html?ruleId=${ruleId}&projId=${projId}",
                mtype: "post",
                datatype: "json",
                autowidth: true,
                shrinkToFit:true,
                height: 270,
                colNames: [ '操作','专家id','规则id','专家编号','项目id','所属项目', '专家姓名','专家类别', '性别', '出生日期', '单位', '职务', '联系电话', '状态','分配状态'],
                colModel: [
					
					{ name: 'operate', width: 160, align:"center", sortable: false,
						formatter : function(val, opts, rowdata) {
								var str = "<a href='${ctx}/expertExtractRule/toExtractExpertDetail.html?expertId=" + rowdata.expertId + "&ruleId=${ruleId}'>专家详情</a>";
					    	return str;
					}},
					{ name: 'expertId',hidden:true, width: 80, align:"center", sortable: false},
					{ name: 'ruleId',hidden:true, width: 80, align:"center", sortable: false},
                    { name: 'expertCode',hidden:true, width: 80, align:"center", sortable: false},
                    { name: 'projId',hidden:true, width: 80, align:"center", sortable: false},
                    { name: 'projName', width: 160, align:"center", sortable: false },
                    { name: 'expertName', width: 80, align:"center", sortable: false }, 
                    { name: 'expertTypeName', width: 180, align:"center", sortable: false},
                    { name: 'sex', width: 60, align:"center", sortable: false},
                    { name: 'birthday', width: 120, align:"center", sortable: false},
                    { name: 'companyId', width: 160, align:"left", sortable: false},
                    { name: 'position', width: 100, align:"center", sortable: false},
                    { name: 'handPhone', width: 120, align:"center", sortable: false},
                    { name: 'status', width: 60, align: 'center', sortable: false,
                    	formatter : function(val, opts, rowdata) {
                    		var strSta = "";
                    		if(rowdata.status == 0){
                    			strSta += "停用";
                    		}else{
                    			strSta += "启用";
                    		}
                    		return strSta;
                    	}
                    },
                    { name: 'allocStatus', width: 80, align: 'center', sortable: false,
                    	formatter : function(val, opts, rowdata) {
                    		var strSta = "";
                    		if(rowdata.allocStatus == 0){
                    			strSta += "未分配";
                    		}else{
                    			strSta += "已分配";
                    		}
                    		return strSta;
                    	}
                    }
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                multiselect: false, 
                viewrecords: true,
                caption: "被抽取专家列表",
                jsonReader: {
                    id: "expertId"
                }
            });
            
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
    </script>
</body>
</html>

